﻿
@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>任务调度</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/layui/css/layui.css">
    <link href="~/layui/css/modules/layer/default/global.css" rel="stylesheet" />
    <link href="~/layui/css/modules/layer/common.css" rel="stylesheet" />
    <link id="layuicss-skinlayercss" rel="stylesheet" href="~/layui/css/modules/layer/default/layer.css" media="all">
    <script src="~/layui/jquery-1.6.4.min.js"></script>
    <script src="/layui/layui.js"></script>
    <script src="~/layui/layer/layer.js"></script>
    <script src="~/Script/Index.js"></script>
</head>
<body>
    <div class="header">
        <div class="main">
            <a class="logo" href="/" title="Fly">任务调度平台</a>
            <ul class="layui-nav fly-nav-user" style="float: right;">
                <li class="layui-nav-item">
                    <a href="/user/login/">退出</a>
                </li>
            </ul>
        </div>
    </div>

    <div class="main layui-clear">

        <div class="site-title">
            <fieldset><legend><a name="input">新增服务</a></legend></fieldset>
        </div>
        <form class="layui-form" action="">
            <div class="layui-form-item">
                <label class="layui-form-label">服务名称</label>
                <div class="layui-input-block">
                    <input type="text" name="Job_ServiceName" required lay-verify="required" placeholder="请输入服务名称" maxlength="20" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">任务名称</label>
                <div class="layui-input-block">
                    <input type="text" name="Job_Name" required lay-verify="required" placeholder="请输入任务名称" maxlength="20" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">分组名称</label>
                <div class="layui-input-block">
                    <input type="text" name="Job_Group" required lay-verify="required" placeholder="请输入分组名称" maxlength="20" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">定时设置</label>
                <div class="layui-input-block">
                    <input type="text" name="SetUpTime" required lay-verify="required" placeholder="请输入定时设置" maxlength="20" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">dll地址</label>
                <div class="layui-input-block">
                    <input type="text" name="Job_DllPath" required lay-verify="required" placeholder="请输入dll地址" maxlength="200" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>

        <script>
            //Demo
            layui.use('form', function () {
                var form = layui.form;

                //监听提交
                form.on('submit(formDemo)', function (data) {
                    //layer.msg(JSON.stringify(data.field));
                      
                    $.ajax({
                        type: "post",
                        data: data.field,
                        url: "/Home/Add",
                        beforeSend: function () {
                            layer.load(0, { shade: [0.5, '#ccc'] })
                        },
                        success: function (data) {
                            
                            if (data.status) {
                                layer.msg(data.msg, { icon: 1});
                            }
                            else {
                                layer.msg(data.msg, { icon: 2, time: 2000 });

                            }
                            layer.closeAll('loading');
                        },
                        complete: function () {
                            layer.closeAll('loading');
                        }
                    });
                    return false;
                });
                 
               



            });
        </script>

    </div>

    <div class="footer">
        <p><a href="http://fly.layui.com/">任务调度</a> 2017 © <a href="http://超.ren/">超.ren</a></p>
        <p>
            <a href="#" target="_blank">产品授权</a>
            <a href="#" target="_blank">版本</a>
            <a href="#" target="_blank">v0.0.0.1</a>
        </p>
    </div>
</body>
</html>